package logic

import (
	"context"
	"dataservice/internal/data"
	"dataservice/internal/types"
	"gitee.com/jmdvirus/jkgo/jk/jklog"

	"dataservice/internal/svc"

	"github.com/tal-tech/go-zero/core/logx"
)

type ZhongChengYaoQueryLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewZhongChengYaoQueryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ZhongChengYaoQueryLogic {
	return &ZhongChengYaoQueryLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *ZhongChengYaoQueryLogic) ZhongChengYaoQuery(req *types.ZhongChengYaoQuery) (resp *types.ZhongChengYaoList, err error) {
	jklog.L().Infof("zhongchengyao query start [%d] limit [%d]\n", req.Start, req.Limit)
	resp = data.GetZhongChengYaoList(req.Start, req.Limit, *req)
	return resp, nil
}
